package model;
// default package

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Tvip entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tvip", catalog = "test", uniqueConstraints = @UniqueConstraint(columnNames = "cardid"))
public class Tvip implements java.io.Serializable {

	// Fields

	private String id;
	private String cardid;
	private String name;
	private String gender;
	private String telephone;
	private Double discount;
	private Double integration;
	private Date createdatetime;
	private Date updatedatetime;
	private Set<Treceipt> treceipts = new HashSet<Treceipt>(0);

	// Constructors

	/** default constructor */
	public Tvip() {
	}

	/** minimal constructor */
	public Tvip(String id) {
		this.id = id;
	}

	/** full constructor */
	public Tvip(String id, String cardid, String name, String gender, String telephone, Double discount, Double integration, Date createdatetime, Date updatedatetime, Set<Treceipt> treceipts) {
		this.id = id;
		this.cardid = cardid;
		this.name = name;
		this.gender = gender;
		this.telephone = telephone;
		this.discount = discount;
		this.integration = integration;
		this.createdatetime = createdatetime;
		this.updatedatetime = updatedatetime;
		this.treceipts = treceipts;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "cardid", unique = true)
	public String getCardid() {
		return this.cardid;
	}

	public void setCardid(String cardid) {
		this.cardid = cardid;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "gender")
	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	@Column(name = "telephone")
	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(name = "discount", precision = 100)
	public Double getDiscount() {
		return this.discount;
	}

	public void setDiscount(Double discount) {
		this.discount = discount;
	}

	@Column(name = "integration", precision = 100)
	public Double getIntegration() {
		return this.integration;
	}

	public void setIntegration(Double integration) {
		this.integration = integration;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "createdatetime", length = 10)
	public Date getCreatedatetime() {
		return this.createdatetime;
	}

	public void setCreatedatetime(Date createdatetime) {
		this.createdatetime = createdatetime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "updatedatetime", length = 10)
	public Date getUpdatedatetime() {
		return this.updatedatetime;
	}

	public void setUpdatedatetime(Date updatedatetime) {
		this.updatedatetime = updatedatetime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tvip")
	public Set<Treceipt> getTreceipts() {
		return this.treceipts;
	}

	public void setTreceipts(Set<Treceipt> treceipts) {
		this.treceipts = treceipts;
	}

}